var ALY = require('aliyun-sdk');

const accessKeyId = 'LTAIufxZXpW5X22K';
const secretAccessKey = 'Hkhnw7pUvMMdj1L8rZw5GInzYGbUOT';
const endpoint = 'http://cloudpush.aliyuncs.com';
const apiVersion = '2016-08-01';
const androidAppKey = '24793577';
const iosAppKey = '24809094';

const push = new ALY.PUSH({
      accessKeyId,
      secretAccessKey,
      endpoint,
      apiVersion
    }
);

module.exports = {
    getPush:function(){
        return push;
    },
    newPush:function(){
        return new ALY.PUSH({
            accessKeyId,
            secretAccessKey,
            endpoint,
            apiVersion
        })
    },
    getAppKey:function(platform){
        if(platform == 'ANDROID'){
            return androidAppKey
        }
        return iosAppKey;
    }
};